// 该文件用于统一管理网络请求
import service from "./request";
// 1.注册请求
export function user_register(params = {}) {
    return service.post('/user/register', params);

}
// 2.登录请求
export function user_login(params = {}) {
    return service.post('/user/login', params);
}
//3.首页导航
export function home_nav(params = {}) {
    return service.get('/index/nav', { params });
}
//4.首页轮播图
export function home_swiper(params = {}) {
    return service.get('/index/banner', { params });
}
//5.首页商品列表
export function home_goodlist(params = {}) {
    return service.get('/index/goodlist', { params });
}
//6.分类一级导航
export function category_list(params = {}) {
    return service.get('/category/list', { params })
}
//7.分类二三级导航
export function category_subcate(params = {}) {
    return service.get('/category/subcate', { params })
}
//8.分类查找（三级分类）// id 三级分类的id 必须传
export function thrid_subcate(params = {}) {
    return service.get('/good/list', { params })
}
// 9.商品详情页

export function good_details(params = {}) {
    return service.get('/good/goodinfo', { params })
}

// 7.搜索页 searchkey 关键词 必须传 , page 页码 非必须 , count 个数 非必须

export function searchkey(params = {}) {
    return service.get('/good/search', { params })
}
// 8.热门搜索 searchkey 

export function hotSearch(params = {}) {
    return service.get('/good/hotsearch', { params })
}
// 9.购物车列表 userid 用户id 必须传

export function goodcart_list(params = {}) {
    return service.get('/shopcart/list', { params })
}

// 9.购物车数量加一 

export function goodcart_goods_add(params = {}) {
    return service.post('/shopcart/add', params)
}
// 9.购物车数量减一 userid 用户id 必须传 , goodid 商品id 必须传

export function goodcart_goods_sub(params = {}) {
    return service.post('/shopcart/sub', params)
}
// 9.购物车清空 userid 用户id 必须传

export function goodcart_goods_clear(params = {}) {
    return service.post('/shopcart/clear', params)
}

// 收藏
export function good_favor(params = {}) {
    return service.post('/good/fav', params);

}
// 取消收藏

export function good_unfavor(params = {}) {
    return service.post('/good/unfav', params);

}
// 收藏列表
export function good_favlist(params = {}) {
    return service.get('/good/favlist', { params });

}




